package com.cx.mapper;

import com.cx.pojo.User;
import com.cx.pojo.UserExample;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserMapper {
    int countByExample(UserExample example);

    int deleteByExample(UserExample example);

//    删除
    int deleteByPrimaryKey(Integer userId);

    int insert(User record);

    int insertSelective(User record);


//   后台 查询所有用户
    List<User> selectByExample(UserExample example);

//    查询用户个人信息
    User selectByPrimaryKey(Integer userId);

    int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);

    int updateByExample(@Param("record") User record, @Param("example") UserExample example);

    int updateByPrimaryKeySelective(User record);

//    改
    int updateByPrimaryKey(User record);

    //根据用户名、密码和手机号获取
    User selectByUser(String phone);

    Integer updateConcernAdd(String userName);
    Integer updateConcernDel(String userName);

    Integer updateFansAdd(String userName);
    Integer updateFansDel(String userName);

    Integer updateStatusAdd(String userName);
    Integer updateStatusDel(String userName);

    //根据手机号查找用户
    String selectPhone(String userPhone);
}
